home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / VBASIC / T2WIN-32.ZIP / _DATYPE.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-01-01  |  11.0 KB  |  278 lines

  1. VERSION 4.00
  2. Begin VB.Form frmDAType 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Disk array : type"
  5.    ClientHeight    =   4065
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3255
  8.    ClientWidth     =   9285
  9.    Height          =   4470
  10.    Left            =   1830
  11.    MaxButton       =   0   'False
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   4065
  14.    ScaleWidth      =   9285
  15.    ShowInTaskbar   =   0   'False
  16.    Top             =   2910
  17.    Width           =   9405
  18.    Begin Threed.SSPanel SSPanel1 
  19.       Align           =   1  'Align Top
  20.       Height          =   480
  21.       Left            =   0
  22.       TabIndex        =   2
  23.       Top             =   0
  24.       Width           =   9285
  25.       _Version        =   65536
  26.       _ExtentX        =   16378
  27.       _ExtentY        =   847
  28.       _StockProps     =   15
  29.       ForeColor       =   -2147483640
  30.       BackColor       =   12632256
  31.       Begin VB.ComboBox cmb_Function 
  32.          Height          =   315
  33.          Left            =   1365
  34.          TabIndex        =   3
  35.          Top             =   90
  36.          Width           =   6570
  37.       End
  38.       Begin Threed.SSCommand cmdNP 
  39.          Height          =   300
  40.          Index           =   1
  41.          Left            =   8925
  42.          TabIndex        =   7
  43.          Top             =   90
  44.          Width           =   255
  45.          _Version        =   65536
  46.          _ExtentX        =   450
  47.          _ExtentY        =   529
  48.          _StockProps     =   78
  49.          Caption         =   ">"
  50.          BevelWidth      =   1
  51.          Font3D          =   3
  52.          RoundedCorners  =   0   'False
  53.          Outline         =   0   'False
  54.       End
  55.       Begin Threed.SSCommand cmdNP 
  56.          Height          =   300
  57.          Index           =   0
  58.          Left            =   8085
  59.          TabIndex        =   6
  60.          Top             =   90
  61.          Width           =   255
  62.          _Version        =   65536
  63.          _ExtentX        =   450
  64.          _ExtentY        =   529
  65.          _StockProps     =   78
  66.          Caption         =   "<"
  67.          BevelWidth      =   1
  68.          Font3D          =   3
  69.          RoundedCorners  =   0   'False
  70.          Outline         =   0   'False
  71.       End
  72.       Begin VB.Label Label2 
  73.          Caption         =   "&Select a function"
  74.          Height          =   255
  75.          Left            =   90
  76.          TabIndex        =   5
  77.          Top             =   120
  78.          Width           =   1275
  79.       End
  80.       Begin Threed.SSCommand SSCommand1 
  81.          Default         =   -1  'True
  82.          Height          =   300
  83.          Left            =   8400
  84.          TabIndex        =   4
  85.          Top             =   90
  86.          Width           =   465
  87.          _Version        =   65536
  88.          _ExtentX        =   820
  89.          _ExtentY        =   529
  90.          _StockProps     =   78
  91.          Caption         =   "&Go"
  92.          BevelWidth      =   1
  93.          RoundedCorners  =   0   'False
  94.          Outline         =   0   'False
  95.       End
  96.    End
  97.    Begin VB.Label lbl_Result 
  98.       Appearance      =   0  'Flat
  99.       BackColor       =   &H80000005&
  100.       BackStyle       =   0  'Transparent
  101.       ForeColor       =   &H80000008&
  102.       Height          =   3345
  103.       Left            =   2940
  104.       TabIndex        =   1
  105.       Top             =   630
  106.       Width           =   6315
  107.    End
  108.    Begin VB.Label lbl_Open 
  109.       Appearance      =   0  'Flat
  110.       BackColor       =   &H80000005&
  111.       BackStyle       =   0  'Transparent
  112.       BeginProperty Font 
  113.          name            =   "Courier New"
  114.          charset         =   0
  115.          weight          =   400
  116.          size            =   8.25
  117.          underline       =   0   'False
  118.          italic          =   0   'False
  119.          strikethrough   =   0   'False
  120.       EndProperty
  121.       ForeColor       =   &H80000008&
  122.       Height          =   3345
  123.       Left            =   90
  124.       TabIndex        =   0
  125.       Top             =   630
  126.       Width           =   2715
  127.    End
  128. Attribute VB_Name = "frmDAType"
  129. Attribute VB_Creatable = False
  130. Attribute VB_Exposed = False
  131. Option Explicit
  132. Option Base 1
  133. Private Const Iteration = 50
  134. Dim IsLoaded         As Integer
  135. Dim TimerStartOk     As Integer
  136. Dim TimerCloseOk     As Integer
  137. Dim TimerHandle      As Integer
  138. Dim TimerValue       As Long
  139.       
  140. Private Sub cmdNP_Click(Index As Integer)
  141.    Call sub_NextPrev(cmb_Function, Index)
  142. End Sub
  143. Private Sub cmb_Function_Click()
  144.    If (IsLoaded = False) Then Exit Sub
  145.    Call cDisableFI(mdiT2W.Picture1)
  146.    lbl_Result = ""
  147.    DoEvents
  148.    Call TestDAType(cmb_Function.ListIndex - 1)
  149.    DoEvents
  150.    Call cEnableFI(mdiT2W.Picture1)
  151. End Sub
  152. Private Sub Form_Activate()
  153.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  154. End Sub
  155. Private Sub Form_Load()
  156.    IsLoaded = False
  157.    Show
  158.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_datype.t2w")
  159.    IsLoaded = True
  160. End Sub
  161. Private Sub Form_Unload(Cancel As Integer)
  162.    Dim intResult        As Integer
  163.    intResult = cKillFileAll("c:\t2w_tmp\datype.tmp")
  164. End Sub
  165. Private Sub SSCommand1_Click()
  166.    Call cmb_Function_Click
  167. End Sub
  168. Private Sub TestDAType(intManagement As Integer)
  169.    Dim intResult        As Integer
  170.    Dim strResult        As String
  171.    Dim strOpen          As String
  172.    Dim strDisplay       As String
  173.    Dim i                As Integer
  174.    Dim DA               As tagDISKARRAY
  175.    Dim SRD              As tagSERIALDATA
  176.    intResult = 0
  177.    strResult = ""
  178.    strOpen = ""
  179.    strDisplay = ""
  180.       
  181.    DA.nFilename = T2WDirTest + "\datype.tmp"
  182.    DA.nType = Len(SRD)
  183.    DA.nIsTyped = True
  184.    DA.nRows = 10
  185.    DA.nCols = 10
  186.    DA.nSheets = 2
  187.    Select Case intManagement
  188.       Case True      'create
  189.          intResult = cDACreate(DA, True)
  190.       Case False     'use
  191.          intResult = cDACreate(DA, False)
  192.       Case 1         'clear all
  193.          intResult = cDACreate(DA, False)
  194.          If (intResult = -1) Then intResult = cDAClear(DA)
  195.       Case 2         'clear sheet 2
  196.          intResult = cDACreate(DA, False)
  197.          If (intResult = -1) Then intResult = cDAClearSheet(DA, 2)
  198.       Case 3         'clear last row
  199.          intResult = cDACreate(DA, False)
  200.          If (intResult = -1) Then intResult = cDAClearRow(DA, DA.nRows, 1)
  201.       Case 4         'clear last col
  202.          intResult = cDACreate(DA, False)
  203.          If (intResult = -1) Then intResult = cDAClearCol(DA, DA.nCols, 1)
  204.       Case 5         'clear last row in all sheets
  205.          intResult = cDACreate(DA, False)
  206.          If (intResult = -1) Then intResult = cDAClearRow(DA, DA.nRows, -1)
  207.       Case 6         'clear last col in all sheets
  208.          intResult = cDACreate(DA, False)
  209.          If (intResult = -1) Then intResult = cDAClearCol(DA, DA.nCols, -1)
  210.    End Select
  211.    strDisplay = strDisplay & "Last intResult = " & intResult & vbCrLf & vbCrLf
  212.    If (intResult = True) Then
  213.       
  214.       strOpen = strOpen & "daSize       = " & DA.daSize & vbCrLf
  215.       strOpen = strOpen & "Signature    = " & DA.signature & vbCrLf
  216.       strOpen = strOpen & "nFilename    = " & Trim$(cGetInPartR(DA.nFilename, "\", True)) & vbCrLf
  217.       strOpen = strOpen & "nType        = " & DA.nType & vbCrLf
  218.       strOpen = strOpen & "nIsTyped     = " & DA.nIsTyped & vbCrLf
  219.       strOpen = strOpen & "nRows        = " & DA.nRows & vbCrLf
  220.       strOpen = strOpen & "nCols        = " & DA.nCols & vbCrLf
  221.       strOpen = strOpen & "nSheets      = " & DA.nSheets & vbCrLf
  222.       strOpen = strOpen & "rHandle      = " & DA.rHandle & vbCrLf
  223.       strOpen = strOpen & "rElementSize = " & DA.rElementSize & vbCrLf
  224.       strOpen = strOpen & "rFileSize    = " & DA.rFileSize & vbCrLf
  225.       strOpen = strOpen & "rParts       = " & DA.rParts & vbCrLf
  226.       strOpen = strOpen & "rRemain      = " & DA.rRemain & vbCrLf
  227.       strOpen = strOpen & "rSheetSize   = " & DA.rSheetSize & vbCrLf
  228.       strOpen = strOpen & "rTime        = " & DA.rTime & vbCrLf & vbCrLf
  229.       If (intManagement = True) Then
  230.       
  231.          SRD.Description1 = "DA type test 1 1 1"
  232.          Call cDAPutType(DA, 1, 1, 1, SRD)
  233.          SRD.Description1 = "DA type test 1 1 " & DA.nCols
  234.          Call cDAPutType(DA, 1, DA.nCols, 1, SRD)
  235.          SRD.Description1 = "DA type test 1 " & DA.nRows & " " & 1
  236.          Call cDAPutType(DA, DA.nRows, 1, 1, SRD)
  237.          SRD.Description1 = "DA type test 1 " & DA.nRows & " " & DA.nCols
  238.          Call cDAPutType(DA, DA.nRows, DA.nCols, 1, SRD)
  239.          SRD.Description1 = "DA type test 2 1 1"
  240.          Call cDAPutType(DA, 1, 1, 2, SRD)
  241.          SRD.Description1 = "DA type test 2 1 " & DA.nCols
  242.          Call cDAPutType(DA, 1, DA.nCols, 2, SRD)
  243.          SRD.Description1 = "DA type test 2 " & DA.nRows & " " & 1
  244.          Call cDAPutType(DA, DA.nRows, 1, 2, SRD)
  245.          SRD.Description1 = "DA type test 2 " & DA.nRows & " " & DA.nCols
  246.          Call cDAPutType(DA, DA.nRows, DA.nCols, 2, SRD)
  247.       End If
  248.       Call cDAGetType(DA, 1, 1, 1, SRD)
  249.       strDisplay = strDisplay & "R:1  , C:1  , D:1, SRD.Description1 : " & cCompress(SRD.Description1) & "   , time : " & DA.rTime & Chr$(13)
  250.       Call cDAGetType(DA, 1, DA.nCols, 1, SRD)
  251.       strDisplay = strDisplay & "R:1  , C:" & DA.nCols & ", D:1, SRD.Description1 : " & cCompress(SRD.Description1) & "   , time : " & DA.rTime & Chr$(13)
  252.       Call cDAGetType(DA, DA.nRows, 1, 1, SRD)
  253.       strDisplay = strDisplay & "R:" & DA.nRows & ", C:1  , D:1, SRD.Description1 : " & cCompress(SRD.Description1) & "   , time : " & DA.rTime & Chr$(13)
  254.       Call cDAGetType(DA, DA.nRows, DA.nCols, 1, SRD)
  255.       strDisplay = strDisplay & "R:" & DA.nRows & ", C:" & DA.nCols & ", D:1, SRD.Description1 : " & cCompress(SRD.Description1) & "   , time : " & DA.rTime & Chr$(13)
  256.       Call cDAGetType(DA, 1, 1, 2, SRD)
  257.       strDisplay = strDisplay & "R:1  , C:1  , D:2, SRD.Description1 : " & cCompress(SRD.Description1) & "   , time : " & DA.rTime & Chr$(13)
  258.       Call cDAGetType(DA, 1, DA.nCols, 2, SRD)
  259.       strDisplay = strDisplay & "R:1  , C:" & DA.nCols & ", D:2, SRD.Description1 : " & cCompress(SRD.Description1) & "   , time : " & DA.rTime & Chr$(13)
  260.       Call cDAGetType(DA, DA.nRows, 1, 2, SRD)
  261.       strDisplay = strDisplay & "R:" & DA.nRows & ", C:1  , D:2, SRD.Description1 : " & cCompress(SRD.Description1) & "   , time : " & DA.rTime & Chr$(13)
  262.       Call cDAGetType(DA, DA.nRows, DA.nCols, 2, SRD)
  263.       strDisplay = strDisplay & "R:" & DA.nRows & ", C:" & DA.nCols & ", D:2, SRD.Description1 : " & cCompress(SRD.Description1) & "   , time : " & DA.rTime & Chr$(13)
  264.    End If
  265.    Call cDAClose(DA, False)
  266.    lbl_Open = strOpen
  267.    lbl_Result = strDisplay
  268.    'time the function
  269.    TimerHandle = cTimerOpen()
  270.    TimerStartOk = cTimerStart(TimerHandle)
  271.    For i = 1 To Iteration
  272.       strResult = cDACreate(DA, False)
  273.       Call cDAClose(DA, False)
  274.    Next i
  275.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  276.    TimerCloseOk = cTimerClose(TimerHandle)
  277. End Sub
  278.